//
//  DataExtension.swift
//  Intersection
//
//  Created by 我骑着蜗牛走天下 on 2025/2/27.
//

import UIKit

extension Data {
    
    /// Base64URL 编码
    public func toBase64URL() -> String {
        let base64 = self.base64EncodedString()
            .replacingOccurrences(of: "+", with: "-")
            .replacingOccurrences(of: "/", with: "_")
            .replacingOccurrences(of: "=", with: "") // 移除填充符
        return base64
    }
    
    
}
